import index.js from 'src/router'
<template>
  <el-container>
    <el-header style="text-align: right; font-size: 12px; background-color: #6495ed">
      <el-col :span="12" style="text-align: left; padding-left: 10px">
        <i class="el-icon-office-building" style="font-size: 50px"></i>
        <b style="font-size: 26px; color: white"> 超市管理系统</b>
      </el-col>
      <el-dropdown>
        <i class="el-icon-setting" style="margin-right: 15px; font-size: 20px"></i>
        <el-dropdown-menu slot="dropdown" style="text-decoration:none;color:inherit">
          <router-link to="/userinf" style="text-decoration:none;color:inherit">
            <el-dropdown-item>查看个人信息</el-dropdown-item>
          </router-link>
          <router-link to="/login" style="text-decoration:none;color:inherit">
            <el-dropdown-item>登出</el-dropdown-item>
          </router-link>
          <router-link to="/login" style="text-decoration:none;color:inherit">
            <el-dropdown-item @click.native="Logout">退出</el-dropdown-item>
          </router-link>

        </el-dropdown-menu>
      </el-dropdown>
      <template>
        <span style="color: aliceblue; font-size: large">{{ this.username }}</span>
      </template>

    </el-header>

    <el-container>
      <!-- 侧边栏 -->
      <el-aside width="200px" style="overflow-y: hidden; min-height: 500px">
        <el-menu background-color="#6495ED" text-color="white" :router="true" :unique-opened="true"
          active-text-color="#FFDEAD">
          <router-link to="/salemenu" style="text-decoration: none; color: inherit">
            <el-menu-item index="/salemenu" style="width: 199px">
              <i class="el-icon-user-solid" style="color: black"></i>
              <span slot="title">销售主页 </span>
            </el-menu-item>
          </router-link>
          <router-link to="/employee" style="text-decoration: none; color: inherit">
            <el-menu-item index="/employee" style="width: 199px">
              <i class="el-icon-user-solid" style="color: black"></i>
              <span slot="title">员工管理 </span>
            </el-menu-item>
          </router-link>
          <el-submenu index="3" style="width: 199px">
            <template slot="title">
              <i class="el-icon-s-custom" style="color: black"></i>
              <span>个人中心</span>
              <i class="el-submenu__icon-arrow el-icon-arrow-down" style="color: black"></i>
            </template>
            <el-menu-item-group>
              <router-link to="/pwd" style="text-decoration: none; color: inherit">
                <el-menu-item index="/pwd" style="width: 199px">密码修改</el-menu-item>
              </router-link>
              <router-link to="/userinf" style="text-decoration: none; color: inherit">
                <el-menu-item index="/userinf" style="width: 199px">个人资料</el-menu-item>
              </router-link>
            </el-menu-item-group>
          </el-submenu>
          <el-submenu index="4" style="width: 199px">
            <template slot="title">
              <i class="el-icon-s-shop" style="color: black"></i>
              <span>库存管理</span>
              <i class="el-submenu__icon-arrow el-icon-arrow-down" style="color: black"></i>
            </template>
            <el-menu-item-group>
              <router-link to="/inInventory" style="text-decoration: none; color: inherit">
                <el-menu-item index="/inInventory">入库明细</el-menu-item>
              </router-link>
              <router-link to="/outInventory" style="text-decoration: none; color: inherit">
                <el-menu-item index="/outInventory">出库订单</el-menu-item>
              </router-link>
              <router-link to="/supplier" style="text-decoration: none; color: inherit">
                <el-menu-item index="/supplier">供应商管理</el-menu-item>
              </router-link>
              <router-link to="/inventorystatistics" style="text-decoration: none; color: inherit">
                <el-menu-item index="inventorystatistics">库存统计</el-menu-item>
              </router-link>
            </el-menu-item-group>
          </el-submenu>
          <router-link to="/VIP" style="text-decoration: none; color: inherit">
            <el-menu-item index="/VIP" style="width: 199px">
              <i class="el-icon-star-on" style="color: black"></i>
              <span slot="title">会员信息</span>
            </el-menu-item>
          </router-link>
          <el-submenu index="6" style="width: 199px">
            <template slot="title">
              <i class="el-icon-s-order" style="color: black"></i>
              <span>商品管理</span>
              <i class="el-submenu__icon-arrow el-icon-arrow-down" style="color: black"></i>
            </template>
            <el-menu-item-group>
              <router-link to="/goods" style="text-decoration: none; color: inherit">
                <el-menu-item index="/goods">商品信息</el-menu-item>
              </router-link>
              <router-link to="/VIPgoods" style="text-decoration: none; color: inherit">
                <el-menu-item index="/VIPgoods">积分商品</el-menu-item>
              </router-link>
              <router-link to="/salestatistics" style="text-decoration: none; color: inherit">
                <el-menu-item index="/salestatistics">销售统计</el-menu-item>
              </router-link>
            </el-menu-item-group>
          </el-submenu>
        </el-menu>
      </el-aside>
      <el-main :class="{ 'remove-padding': shouldRemovePadding }">
        <router-view />
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
// import axios from 'axios';
export default {
  data() {
    return {
      
      shouldRemovePadding: false,
      empId: "",
      cusId: "",
      username: "",
      password: "",
    }
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
    Logout() {
      localStorage.removeItem('empId');
      localStorage.removeItem('cusId');
      localStorage.removeItem('username');
      localStorage.removeItem('password');
    },

    init() {
      this.empId = localStorage.getItem('empId');
      this.cusId = localStorage.getItem('cusId');
      this.username = localStorage.getItem('username') || "";
      this.password = localStorage.getItem('password') || "";
    },


  },
  mounted() {
    this.init();
  },
};
</script>

<style scoped>
.remove-padding {
  padding: 0;
  /* 去掉 el-main 的 padding */
}

.avatar {
  display: inline-block;
  width: 200px;
  float: right;
}

.personalFul {
  background-color: #ffffff;
  position: absolute;
  z-index: 999999;
  top: 58px;
  right: 20px;
  width: 151px;
}

.el-header {
  background-color: #b3c0d1;
  color: #333;
  line-height: 60px;
}

.el-aside {
  color: #333;
}

.el-menu {
  height: 700px;
  width: 199px;
}

.el-submenu {
  min-width: 199px;
}

.el-menu-item {
  min-width: 199px;
}

.el-main {
  background: none;
  color: #333;
  text-align: center;
  line-height: 60px;
}

/* .el-main {
    background-color: #E9EEF3;
    color: #333;
    text-align: center;
} */

/* .router-link {
  text-decoration: none;
  color: inherit;
} */

/* 更改折叠下拉箭头的颜色 */
/* .el-menu--collapse .el-submenu__icon-arrow,
.el-menu--collapse .el-menu-item__icon-arrow {
  color: black;
} */
</style>